package cskevin.thermometer.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import cskevin.utils.DocUtils;
/**
 * 本地数据库帮助类
 * @author csKevin
 *
 */
public class LDBHelper extends SQLiteOpenHelper{
	
	private static final String CREBAS_SQL = "crebas.sql";
	private static final String NAME = "thermometer";
	private static final CursorFactory FACTORY = null;
	private static final int VERSION = 0;
	private Context context;
	public LDBHelper(Context context) {
		super(context, NAME, FACTORY, VERSION);
		// TODO Auto-generated constructor stub
		this.context = context;
	}

	@SuppressWarnings("null")
	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		String crebas = DocUtils.getDocContent(CREBAS_SQL);
		if(db == null){
			db.execSQL(crebas);
		}
	}
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
